﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace ADAuthentication.Web
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable dTable = new DataTable();
                dTable.Columns.Add("ID");
                dTable.Columns.Add("Name");
                dTable.Rows.Add(new string[] { "1", "Ding" });
                dTable.Rows.Add(new string[] { "11", "1Ding" });
                GridView1.DataSource = dTable;
                GridView1.DataBind();
            }
        }

        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {

        }

        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                var dd = e.Row.DataItem;
                var v = DataBinder.Eval(dd, "ID");
            }
        }
    }
}